package cwnu.sapphire.com.service.impl;

import cwnu.sapphire.com.entity.Admin;
import cwnu.sapphire.com.mapper.AdminMapper;
import cwnu.sapphire.com.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;

    @Override
    public List<Admin> list() {
        return adminMapper.selectList(null);
    }

    @Override
    public Admin getById(Integer id) {
        return adminMapper.selectById(id);
    }

    @Override
    public boolean save(Admin admin) {
        return adminMapper.insert(admin) > 0;
    }

    @Override
    public boolean updateById(Admin admin) {
        return adminMapper.updateById(admin) > 0;
    }

    @Override
    public boolean removeById(Integer id) {
        return adminMapper.deleteById(id) > 0;
    }
} 